export const rgb2hex = (r, g, b) => {
  return "#" + ((r << 16) + (g << 8) + b).toString(16);
};

export const throttle = (fn, delay) => {
  let lastTime = 0;
  return function (...args) {
    const now = Date.now();
    if (now - lastTime > delay) {
      fn.call(this, ...args);
      lastTime = now;
    }
  }
};
